package com.yanqu.road.task;

import com.yanqu.road.message.YanQuMessage;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.yanqu.road.connect.AgentServerLinkControl;

import io.netty.channel.ChannelHandlerContext;

public class ClientCommandTask implements Runnable {

    private static Logger logger = LogManager.getLogger(ClientCommandTask.class.getName());

    private ChannelHandlerContext ctx;
    private YanQuMessage yanQuMessage;

    public ClientCommandTask(ChannelHandlerContext ctx, YanQuMessage yanQuMessage) {
        this.ctx = ctx;
        this.yanQuMessage = yanQuMessage;
    }

    @Override
    public void run() {
        RouteRule.route(ctx, yanQuMessage);
    }

    @Override
    public String toString() {
        return "message str:" + yanQuMessage;
    }
}
